import QtQuick 2.11

import "."
import "_Global"
import "_Global/Button"

import "_Global/Global.js" as GlobalJS
import "GameJS.js" as GameJS

/*
  选择模式(汉译英,英译汉)界面
*/

Item {
    signal s_choiceType(int typeID)       //选择信号
    signal s_close()                    //关闭信号
    signal showConfig()

    id: root
    anchors.fill: parent

    Image { //背景
        id: backImage
        source: Global._FixResourcePath_R("Media/Images/Grades/Back.png")
        anchors.fill: parent
    }

    ImageButton2 {  //设置
        x: Global.dpW(1820)
        y: Global.dpH(0)
        width: Global.dpW(100)
        height: Global.dpH(100)
        source: Global._FixResourcePath_R("Media/Images/Exit/Config.png")

        soundEffectClick: Global.resource.effects.effectButton
        bEffectOn: Global.config.bEffectOn

        onButtonClicked: {
            showConfig();
        }
    }

    ImageButton2 {
        id: buttonReturn
        x: Global.gamePos.mapGameStudyType.rectReturn.x
        y: Global.gamePos.mapGameStudyType.rectReturn.y
        width: Global.gamePos.mapGameStudyType.rectReturn.width
        height: Global.gamePos.mapGameStudyType.rectReturn.height
        source: Global._FixResourcePath_R("Media/Images/Return.png")

        soundEffectClick: Global.resource.effects.effectButton
        bEffectOn: Global.config.bEffectOn

        onButtonClicked: {
            s_close();
        }
    }




    ImageButton2 {
        id: buttonRead
        x: Global.gamePos.mapGameStudyType.rectButtonRead.x
        y: Global.gamePos.mapGameStudyType.rectButtonRead.y
        width: Global.gamePos.mapGameStudyType.rectButtonRead.width
        height: Global.gamePos.mapGameStudyType.rectButtonRead.height

        soundEffectClick: Global.resource.effects.effectButton
        bEffectOn: Global.config.bEffectOn

        source: Global._FixResourcePath_R("Media/Images/StudyTypes/Read.png")

        onButtonClicked: {
            s_choiceType(1)
        }
    }

    ImageButton2 {
        id: buttonWrite
        x: Global.gamePos.mapGameStudyType.rectButtonWrite.x
        y: Global.gamePos.mapGameStudyType.rectButtonWrite.y
        width: Global.gamePos.mapGameStudyType.rectButtonWrite.width
        height: Global.gamePos.mapGameStudyType.rectButtonWrite.height

        soundEffectClick: Global.resource.effects.effectButton
        bEffectOn: Global.config.bEffectOn

        source: Global._FixResourcePath_R("Media/Images/StudyTypes/Write.png")

        onButtonClicked: {
            s_choiceType(2)
        }
    }


    QtObject {
        id: _private

    }

    Component.onCompleted: {


    }

}
